package main

import (
	"fmt"
	"math/rand"
	"time"
	"sort"
)

//切片参数是地址引用 数组是值引用
func main() {

	len1 := 10
	slice1 := make([]int, len1)

	setValueRandom(slice1)
	fmt.Println("before sort", slice1)
	sortSlice(slice1)
	fmt.Println("after sort", slice1)
}
func sortSlice(a []int) {
	sort.Ints(a)
}
func setValueRandom(a []int) {
	rand.Seed(time.Now().UnixNano())

	for k, _ := range a {
		a[k] = rand.Intn(100)
	}
}
